//=============================================================================
//     _   _                               ____                _  _          
//    | | | |  __ _  _ __   _ __   _   _  / ___|  _ __   _ __ (_)| |_   ___ 
//    | |_| | / _` || '_ \ | '_ \ | | | | \___ \ | '_ \ | '__|| || __| / _ \
//    |  _  || (_| || |_) || |_) || |_| |  ___) || |_) || |   | || |_ |  __/
//    |_| |_| \__,_|| .__/ | .__/  \__, | |____/ | .__/ |_|   |_| \__| \___|
//                  |_|    |_|     |___/         |_|                         
//
//                     HappySprite - We make sprites happy
//
// Copyright (c) 2007 by Tank Monkey Games
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//=============================================================================

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using HappySprite.Audio;
using HappySprite.Graphics;

namespace HappySprite
{
    public static class Global
    {
        static AudioManager audioManager;
        static ContentManager contentManager;
        static EventScheduler eventScheduler;
        static Game game;
        static InputManager inputManager;
        static Random random = new Random();
        static Renderer renderer;
        static RecycleBin recycleBin = new RecycleBin();

        public static void Initialize(Game game)
        {
            // Check argument
            if (game == null) throw new ArgumentNullException("game");

            Global.game = game;

            // Rendering system
            renderer = new Renderer(new GraphicsDeviceManager(game));

            // Content management system
            contentManager = new ContentManager(game.Services, "Content");

            // Input system
            inputManager = new InputManager(game);

            // Event scheduler
            eventScheduler = new EventScheduler(game);

            // Audio manager
            audioManager = new AudioManager(game);
        }

        public static AudioManager Audio
        {
            get { return audioManager; }
            set { audioManager = value; }
        }

        public static ContentManager Content
        {
            get { return contentManager; }
            set { contentManager = value; }
        }

        public static EventScheduler EventScheduler
        {
            get { return eventScheduler; }
            set { eventScheduler = value; }
        }

        public static InputManager Input
        {
            get { return inputManager; }
            set { inputManager = value; }
        }

        public static Random Random
        {
            get { return random; }
            set { random = value; }
        }

        public static RecycleBin RecycleBin
        {
            get { return recycleBin; }
        }

        public static Renderer Renderer
        {
            get { return renderer; }
            set { renderer = value; }
        }
    }
}
